package cn.y.operation.framework.pojo;


import cn.y.operation.framework.enums.ResponseMsgEnum;

import java.io.Serializable;

@SuppressWarnings("serial")
public class ExportStatus implements Serializable {

    private Boolean complete;//是否结束

    private Integer code;

    private String msg;

    private Integer index;

    private Integer total;

    private Integer successCount;//成功总数

    private Integer failCount; //失败总数

    public ExportStatus() {
        super();
        this.complete = false;
    }

    public void setEndStatus(ResponseMsgEnum em) {
        this.code = em. getCode();
        this.msg = em. getInfo();
        this.complete = true;
    }

    public void setStatus(ResponseMsgEnum em) {
        this.code = em. getCode();
        this.msg = em. getInfo();
    }

    public void setStatus(ResponseMsgEnum em, Integer total) {
        this.code = em. getCode();
        this.msg = em. getInfo();
        this.total = total;
        this.successCount = 0;
        this.failCount = 0;
    }

    public void setStatus(Integer index, Integer successCount) {
        this.index = index;
        this.successCount = successCount;
        this.failCount = index - successCount;
    }

    public void setResult(ResponseMsgEnum em, Integer successCount) {
        this.code = em. getCode();
        this.msg = em. getInfo();
        this.successCount = successCount;
        this.failCount = this.total - successCount;
        this.complete = true;
    }

    public Boolean getComplete() {
        return complete;
    }

    public void setComplete(Boolean complete) {
        this.complete = complete;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        this.index = index;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getSuccessCount() {
        return successCount;
    }

    public void setSuccessCount(Integer successCount) {
        this.successCount = successCount;
    }

    public Integer getFailCount() {
        return failCount;
    }

    public void setFailCount(Integer failCount) {
        this.failCount = failCount;
    }

}
